/*
 *  Copyright 2022 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import '../../styles/variables.less';

@left-panel-border-color: rgb(229, 231, 235);
@box-shadow-color: rgba(0, 0, 0, 0.06);
@icon-color: #515151;
@group-title-color: #76746f;
@summary-card-bg-hover: #f0f1f3;
@target-blue-color: #1890ff;

.data-insight-select-dropdown {
  min-width: 136px;
  .ant-select-arrow {
    color: @text-color !important;
  }
}

.data-insight-left-panel.ant-menu-root.ant-menu-inline {
  background: @white;
  border: 0px;
  margin-top: 16px;

  .ant-menu-item::after {
    left: 0;
    right: unset;
  }

  .ant-menu-item-group:not(:first-child) {
    border-top: 1px solid @box-shadow-color;
  }

  .ant-menu-item-group-title {
    font-size: 12px;
    padding: 12px 16px;
    color: @group-title-color;
  }

  .ant-menu-item-icon + span {
    margin-left: 16px;
  }

  .ant-menu-item {
    height: 30px;
    line-height: 30px;
    margin-top: 2px;
    padding: 0 16px !important;
  }

  .ant-menu-item:hover,
  .ant-menu-item-selected {
    .side-panel-icons {
      color: @primary-color;
    }
  }

  .ant-menu-item-selected {
    .ant-menu-title-content {
      font-weight: 600;
    }
  }

  .ant-menu-item:not(:last-child) {
    margin-bottom: 0px;
  }

  .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
    border-right: 1px solid @left-panel-border-color;
  }
}

.side-panel-icons {
  color: @icon-color;
}

.data-insight-progress-bar {
  .ant-progress-bg,
  .ant-progress-success-bg {
    // library has given height directly via style attribute , so to override need to provide !important
    height: 26px !important;
  }

  .ant-progress-outer {
    margin-right: 0;
    padding-right: 0;
  }
  .ant-progress-inner,
  .ant-progress-bg,
  .ant-progress-success-bg {
    border-radius: 4px;
  }
  .ant-progress-text {
    display: flex;
    margin: 0;
    position: absolute;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    top: 0px;
    right: 2px;
    left: 2px;
    padding: 0 16px 0 8px;
    font-size: 12px;
    color: @text-color;
  }
  .data-insight-kpi-target {
    height: 100%;
    position: absolute;
    left: 0;
    border-right: 2px solid @target-blue-color;

    .target-text {
      position: relative;
      right: -8px;
      top: -14px;
      display: flex;
      justify-content: flex-end;
      font-size: 10px;
    }

    &::after {
      content: '●';
      position: absolute;
      top: -5px;
      right: -6px;
      color: @target-blue-color;
      font-size: 10px;
    }
  }
}

.custom-data-insight-legend {
  display: flex;
  gap: 4px;

  .custom-data-insight-legend-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    color: @text-grey-muted;

    &:hover {
      background: @summary-card-bg-hover;
    }
  }
}
